package com.lyl.excel.common.annotation;

import com.lyl.excel.common.validator.ListValueConstraintValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @author 罗亚龙
 * @date 2021/9/16 11:16
 */
@Constraint(validatedBy = {ListValueConstraintValidator.class})
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface ListValue {
    //配置文件中错误提示信息的名称
    String message() default "只能为指定值{value}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    //属性值
    String[] value();

    //是否必传
    boolean required() default true;
}
